home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3085 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Fastest way to clear a Window?
  5. Date: 10 Feb 1996 22:24:24 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4fj5uo$1lo@maureen.teleport.com>
  8. References: <4fck5b$7mm@leofric.coventry.ac.uk> <4fcush$58b@apoll.informatik.uni-bonn.de>
  9. NNTP-Posting-Host: kelly.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Andreas Malerz (malerz@athene.informatik.uni-bonn.de) wrote:
  13. : Dave Jackson (dj@coventry.ac.uk) wrote:
  14. : : I'm writing a 3d graphics viewer thingy using intuition windows.  What I 
  15. : : want to know is, what is the fastest way of clearing a window?  At the 
  16. : : moment I'm using SetRast() but there must be a faster way.  I'm using a 
  17. : : custom screen, so I could make it draw lines on a single bitplane and 
  18. : : then just clear that one plane, but the RKM:Libraries has nothing on how 
  19. : : to clear one plane...  help!
  20.  
  21. : : TIA
  22. : : Dave Jackson
  23.  
  24. : Depending on your processor, you can try to do it with the CPU itself.
  25. : The fastest way I know is the following:
  26.  
  27. :   Save all registers on STACK
  28. :   Save STACK-Pointer somewhere else
  29.  
  30. :   Clear all registers
  31. :   Put the Address of your bitplane in one Adressregister
  32. :   Copy the registers to your plane with "movem"
  33. :   Do the last step as often as necessary.
  34.  
  35. :   Restore STACK-Pointer
  36. :   Restore all registers.
  37.  
  38. : This solution is systemfriendly and on a fast processor faster than the
  39. : blitter.
  40.  
  41.  Thats a VERY ugly solution, since you need to stop multitasking/interupt.
  42.  (So add disable()/enable() in you code :)
  43.  
  44.  I think its not that much faster (if at all) then just using 
  45.  
  46. .. REPEAT 64
  47.    move.l d0,(a0)+
  48.    ENDR
  49.    loop ..
  50.  
  51.  Also I would really think twice before waisting so much CPU just clearing
  52.  slow memory... You might be able to do something in betwen the 'clear'
  53.  instructions.
  54.  
  55.  For layered window you want the os to call you for each cliped region
  56.  and do a 3 pass clear... 32bit masked left/right side, then simple move 
  57.  for the the middle. The OS probably use the blitter and use a A/B/D mode for
  58.  the full clear area , plus use cpu busy wait loop.
  59.  My guess is that you can clear window background ~4time faster 
  60.  using custom code with 32bit chip VS the OS, and you still have the
  61.  full blitter to be used for something usefull.(The OS will hug the cpu
  62.  doing nothing will it very ineficiently clear)
  63.  
  64.  But I dont think the original poster actually want to clear an intuition
  65.  window when doing 3d....
  66.  
  67.  Stephan
  68.